import type { AddPos, updatePos } from '@/model'
import request from '@/utils/request'


export const getPosHis = (id: number) => request.get(`/getPosHis/${id}`)
export const getPosition = () => request.get('/getPos')
export const getOnePos = (id: Number) => request.get(`/getPos/${id}`)
export const getPosStaffList = (id: Number) => request.get(`/getPosStaffList/${id}`)
export const addPos = (ruleForm: AddPos) => request.post('/addPos', JSON.stringify(ruleForm), {
  headers: {
    'Content-Type': 'application/json'
  }
}
)
export const updatePosition = (updateForm: updatePos) => request.post('/updatePos', JSON.stringify(updateForm), {
  headers: {
    'Content-Type': 'application/json'
  }
}
)
export const selectPos = (posName: string,posStatus:string) => 
  request.get(`/selectPos`, { params: { posName:posName,posStatus:posStatus } })
export const updateStatus = (posId:number,posStatus:string) => request.get(`/updateStatus/${posId}/${posStatus}`)
